#ifndef TOKENIZER_H_INCLUDED
#define TOKENIZER_H_INCLUDED
#include "Token.h"
#include <fstream>
#include <iostream>
using namespace std;

class Tokenizer
{
public:
    Tokenizer(string inputPath)
    {
        inputFile.open(inputPath.c_str(), ios::in);
    }

    ~Tokenizer()
    {
        inputFile.close();
    }

	Token* NextToken()
	{
	    string tokenStr;
	    if (inputFile.is_open())
        {
            if (! inputFile.eof() )
            {
                getline (inputFile, tokenStr);
                cout << tokenStr << endl;
                return currentToken = new Token(tokenStr);
            }
        }
        return NULL;
    }

    Token*& CurrentToken()
    {
        return currentToken;
    }

private:
    ifstream inputFile;
    Token* currentToken;
};


#endif // TOKENIZER_H_INCLUDED
